-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialize diagnostics when opening a document #8873
Initialize diagnostics when opening a document #8873
Conversation
cc392c2
to
83d85cb
Compare
Highlights in workspace diagnostics picker didn't work anymore with the newest changes, the last commit should fix that |
33e4af1
to
2a1445e
Compare
Since there were quite some merge conflicts to resolve, I tried again with reusing Can you check again @pascalkuthe? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good to me now! Mostly just some style nits. I will test this locally for a few days.
One thing that is still missing is that you need to repopulate diagnostics on config reload in case the diagnostics feature was enabled/disabled for some LS.
…can be changed and removed unused method Document::set_language2
I think I have covered this now everywhere where the language configuration can be changed, let me know if I missed something (or was to thorough). |
I've noticed, that diagnostics that are sent from the language server aren't propagated when opening a document (via
helix_view::Document::open
). So that the language server needs to send aPublishDiagnostics
again to populate the document with diagnostics. This can take some time (noticed with rust-analyzer), when opening a file via the workspace diagnostic picker (if it is sent at all).This PR should ensure that diagnostics that are already in the editor instance are propagated when opening a document.
This has the additional advantage, that diagnostics can be rendered directly in the workspace diagnostic picker, when the file/buffer isn't open yet.